package com.china.produce.service;

import java.util.Objects;
import java.util.function.Function;

/**
 * @ClassName
 * @Author niujie
 * @Version
 * @Description
 * @CreateTime 2023/7/29
 */
@FunctionalInterface
public interface MyFunction<T, R> {

    R apply(T t);


    default <V> MyFunction<V, R> compose(MyFunction<? super V, ? extends T> before) {
        Objects.requireNonNull(before);
        return (V v) -> apply(before.apply(v));
    }

}
